from sknn.mlp import Regressor, Layer
import numpy as np

X = [[6, 2], [8, 1], [10, 0], [14, 2], [18, 0]]
y = [[7],    [9],    [13],    [17.5],  [18]]

nn = Regressor(
    layers=[
        Layer("Rectifier", units=2),
        Layer("Linear")],
    learning_rate=0.001,
    n_iter=30)

nn.fit(np.array(X), np.array(y))
X_test = [[8, 2], [9, 0], [11, 2], [16, 2], [12, 0]]
y_test = [[11],   [8.5],  [15],    [18],    [11]]

pre = nn.predict(np.array(X_test))

print pre
